from flask import Flask, render_template, request

app = Flask(__name__)


@app.route('/register', methods=['GET', 'POST'])
def register():
    if request.method == 'GET':
        print(request.args)
        return render_template('register.html')
    else:
        print(request.form)
        return '注册成功'


@app.route('/login', methods=['GET', 'POST'])
def login():
    if request.method == 'GET':
        return render_template('login.html')
    else:
        print(request.form)
        return '登录成功'


@app.route('/index', methods=['GET'])
def index():
    return render_template('/index.html')


# @app.route('/add_info',methods=['GET'])
# def add_info():
#     # 1，接收用户通过GET请求发送过来的数据
#     print(request.args)
#     # 2,给用户返回数据
#     return '注册成功'

# @app.route('/add_info', methods=['POST'])
# def add_info():
#     print(request.form)
# user = request.form.get('user')
# pwd = request.form.get('pwd')
# gender = request.form.get('gender')
# hobby = request.form.getlist('hobby')
# city = request.form.get('city')
# skill = request.form.get('skill')
# more = request.form.get('more')
# print(user, pwd, gender, hobby, city, skill, more)

# return '注册成功'


if __name__ == '__main__':
    app.run()
